package com.aba.cms.teacher;

import java.time.DayOfWeek;
import java.time.LocalTime;

public class Course {
    private int id;
    private String courseName;
    private String courseCode;
    private String classroom;
    private DayOfWeek dayOfWeek;
    private LocalTime startTime;
    private LocalTime endTime;
    private Teacher teacher;

    public Course() {}

    public Course(int id, String courseName, String courseCode, String classroom, 
                  DayOfWeek dayOfWeek, LocalTime startTime, LocalTime endTime, Teacher teacher) {
        this.id = id;
        this.courseName = courseName;
        this.courseCode = courseCode;
        this.classroom = classroom;
        this.dayOfWeek = dayOfWeek;
        this.startTime = startTime;
        this.endTime = endTime;
        this.teacher = teacher;
    }

    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getCourseName() { return courseName; }
    public void setCourseName(String courseName) { this.courseName = courseName; }
    public String getCourseCode() { return courseCode; }
    public void setCourseCode(String courseCode) { this.courseCode = courseCode; }
    public String getClassroom() { return classroom; }
    public void setClassroom(String classroom) { this.classroom = classroom; }
    public DayOfWeek getDayOfWeek() { return dayOfWeek; }
    public void setDayOfWeek(DayOfWeek dayOfWeek) { this.dayOfWeek = dayOfWeek; }
    public LocalTime getStartTime() { return startTime; }
    public void setStartTime(LocalTime startTime) { this.startTime = startTime; }
    public LocalTime getEndTime() { return endTime; }
    public void setEndTime(LocalTime endTime) { this.endTime = endTime; }
    public Teacher getTeacher() { return teacher; }
    public void setTeacher(Teacher teacher) { this.teacher = teacher; }

    @Override
    public String toString() {
        return "课程ID: " + id +
               ", 课程名称: " + courseName +
               ", 课程代码: " + courseCode +
               ", 授课教师: " + (teacher != null ? teacher.getName() : "未知") +
               ", 教室: " + classroom +
               ", 星期: " + dayOfWeek +
               ", 时间: " + startTime + " - " + endTime;
    }
}    